package com.zito.health.controller;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zito.health.common.annotations.ResponseResult;
import com.zito.health.common.result.PageResult;
import com.zito.health.common.result.VerifyResult;
import com.zito.health.dto.LaboratoryDto;
import com.zito.health.entity.LaboratoryPicture;
import com.zito.health.entity.User;
import com.zito.health.service.LaboratoryPictureService;
import com.zito.health.util.CacheUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description: 实验室附件
 * @author: sam
 * @time: 2019/12/09 15:47
 */
@Slf4j
@ResponseResult
@RestController
@RequestMapping("/laboratoryPicture")
public class LaboratoryPictureController {

    @Autowired
    private LaboratoryPictureService laboratoryPictureService;

    @PostMapping()
    public VerifyResult save(LaboratoryPicture laboratoryPicture){
        VerifyResult verifyResult = new VerifyResult();
        laboratoryPictureService.save(laboratoryPicture);
        return verifyResult;
    }

    @GetMapping
    public List<LaboratoryPicture> list(LaboratoryPicture laboratoryPicture){

        List<LaboratoryPicture> list = laboratoryPictureService.query(laboratoryPicture);
        return list;
    }

    /**
     * 实验室删除
     * @param id
     * @return
     */
    @DeleteMapping("/{id}")
    public VerifyResult delete(@PathVariable Integer id){
        VerifyResult verifyResult = new VerifyResult();
        laboratoryPictureService.delete(id);
        return verifyResult;
    }



}
